package com.code.base.dic.service;

import java.util.List;
import java.util.Date;
import java.util.Map;
import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.code.base.dic.persistence.DicBankInfoMapper;
import com.code.base.dic.pojo.DicBankInfo;
import com.code.util.PrimaryKeyUtil;


@Service
public class DicBankInfoService {


	@Resource
	private DicBankInfoMapper dicBankInfoMapper;

	public Long getInsertId() {
		return PrimaryKeyUtil.generatePrimaryKey();
	}

	public DicBankInfo getDataById(Long id) {
		return dicBankInfoMapper.getDataById(id);
	}

	public List<DicBankInfo> getAllData() {
		return dicBankInfoMapper.getAllData();
	}

	public int getDataCountByCondition(DicBankInfo entity) {
		return dicBankInfoMapper.getDataCountByCondition(entity);
	}

	public List<DicBankInfo> getDataByCondition(DicBankInfo entity) {
		return dicBankInfoMapper.getDataByCondition(entity);
	}

	public int getDataCountByLikeCondition(DicBankInfo entity) {
		return dicBankInfoMapper.getDataCountByLikeCondition(entity);
	}

	public List<DicBankInfo> getDataByLikeCondition(DicBankInfo entity) {
		return dicBankInfoMapper.getDataByLikeCondition(entity);
	}

	public List<DicBankInfo> getDataByIds(Long[] ids) {
		return dicBankInfoMapper.getDataByIds(ids);
	}

	public void insertData(DicBankInfo entity) {
		insertData(entity, true);
	}

	public void insertData(DicBankInfo entity, boolean setIdValue) {
		if (setIdValue) {
			entity.setId(getInsertId());
		}
		dicBankInfoMapper.insertData(entity);
	}

	public void updateData(DicBankInfo entity) {
		dicBankInfoMapper.updateData(entity);
	}

	public void updateDataByParam(Map<String, Object> map) {
		if (map.size() == 0)
			return;

		dicBankInfoMapper.updateDataByParam(map);
	}

	public void deleteDataByObject(DicBankInfo entity) {
		dicBankInfoMapper.deleteDataByObject(entity);
	}

	public void deleteDataById(Long id) {
		dicBankInfoMapper.deleteDataById(id);
	}

	public void deleteDataByIds(Long[] ids) {
		dicBankInfoMapper.deleteDataByIds(ids);
	}

}
